Methods and devices for vector segmentation for coding

ABSTRACT

A method for partitioning of input vectors for coding is presented. The method comprises obtaining ( 210 ) of an input vector. The input vector is segmented ( 220 ), in a non-recursive manner, into an integer number, N SEG , of input vector segments. A representation of a respective relative energy difference between parts of the input vector on each side of each boundary between the input vector segments is determined ( 230 ), in a recursive manner. The input vector segments and the representations of the relative energy differences are provided ( 250 ) for individual coding. Partitioning units and computer programs for partitioning of input vectors for coding, as well as positional encoders, are presented.

CROSS REFERENCE TO RELATED APPLICATION(S)

This application is a 35 U.S.C. § 371 National Phase Entry Applicationfrom PCT/SE2014/051310, filed Nov. 6, 2014, designating the UnitedStates, and also claims the benefit of U.S. Provisional Application No.61/901,089, filed Nov. 7, 2013. The disclosures of both applications areincorporated herein in their entirety by reference.

TECHNICAL FIELD

The proposed technology generally relates to methods and devices forvector segmentation and in particular to methods, partitioning units,encoders, computer programs, carriers comprising the computer programsand apparatuses for partitioning of input vectors originating fromaudio/video signals for coding.

BACKGROUND

Examples of positional coding schemes e.g. for encoding of an audiosignal are Factorial Pulse Coding (FPC) and Pyramid Vector Quantization(PVQ). A positional coding could result in large codeword indices,especially for a long input vector, because of the rapidly increasingnumber of combinations by increasing dimensions. For low complexityimplementations, a pre-processing step of clustering of the input vectorcan be used. Another reason for this type of pre-processing can bequantizer restraints. However, a conventional clustering may result inthat different parts of the input vector have very different sizes,which could make the positional coding very inefficient. Thus, there isa need to provide an improved pre-processing of the input vector atpositional encoding.

SUMMARY

It is an object to provide methods and devices for efficientpartitioning of input vectors.

This and other objects are met by embodiments of the proposedtechnology.

According to a first aspect, there is provided a method for partitioningof input vectors for coding. The method comprises obtaining of an inputvector. The input vector is segmented, in a non-recursive manner, intoan integer number, N^(SEG), of input vector segments. A representationof a respective relative energy difference between parts of the inputvector on each side of each boundary between the input vector segmentsis determined, in a recursive manner. The input vector segments and therepresentations of said relative energy differences are provided forindividual coding.

According to a second aspect, a partitioning unit is configured topartition input vectors for coding. The partitioning unit is configuredto obtain an input vector. The partitioning unit is further configuredto segment, in a non-recursive manner, the input vector into an integernumber, N^(SEG), of input vector segments. The partitioning unit is alsoconfigured to determine, in a recursive manner, a representation of arespective relative energy difference between parts of the input vectoron each side of each boundary between the input vector segments. Thepartitioning unit is further configured to provide the input vectorsegments and the representations of said relative energy differences forindividual coding.

According to a third aspect, an encoder for positional encodingcomprises an input unit configured to receive an input vectorrepresenting a signal, a partitioning unit according to the firstaspect, a quantizer and an output unit for an encoded signal.

According to a fourth aspect, a computer program comprises instructions,which when executed by at least one processor, cause the at least oneprocessor to obtain an input vector, to segment, in a non-recursivemanner, the input vector into an integer number, N^(SEG), of inputvector segments, to determine, in a recursive manner, a representationof a respective relative energy difference between parts of the inputvector on each side of each boundary between the input vector segments,and to provide the input vector segments and the representations of saidrelative energy differences for individual coding.

According to a fifth aspect, a carrier comprises the computer program ofthe fourth aspect, wherein the carrier is one of an electronic signal,an optical signal, an electromagnetic signal, a magnetic signal, anelectric signal, a radio signal, a microwave signal, or acomputer-readable storage medium.

According to a sixth aspect, an apparatus for partitioning of inputvectors for coding comprises an obtaining module for obtaining an inputvector. The apparatus also comprises a segmenting module for segmenting,in a non-recursive manner, the input vector into an integer number,N^(SEG), of input vector segments. The apparatus further comprises arecursive determining module for determining, in a recursive manner, arepresentation of a respective relative energy difference between partsof the input vector on each side of each boundary between the inputvector segments. The apparatus further comprises a providing module forproviding the input vector segments and the representations of saidrelative energy differences for individual coding.

An advantage of the proposed technology is that input vectors aresegmented for efficient coding, in particular positional coding,irrespectively of differing sizes and energy content.

Other advantages will be appreciated when reading the detaileddescription.

BRIEF DESCRIPTION OF THE DRAWINGS

The embodiments, together with further objects and advantages thereof,may best be understood by making reference to the following descriptiontaken together with the accompanying drawings, in which:

FIGS. 1A-1B are illustrations of partitioning of input vectors forpositional encoding;

FIG. 2 is a flow diagram of steps of an embodiment of a method forpartitioning of input vectors originating from audio/video signals forcoding;

FIGS. 3-6 are illustrations of a recursive process for determining arepresentation of a respective relative energy difference between partsof an input vector;

FIG. 7 is a flow diagram of steps of an embodiment of a step ofrecursively determining a representation of a respective relative energydifference between parts of an input vector;

FIG. 8 is a block diagram of an embodiment of a partitioning unit;

FIG. 9 is a block diagram of another embodiment of a partitioning unit;

FIG. 10 is a block diagram of an embodiment of a positional encoder;

FIG. 11 is a block diagram of another embodiment of a positionalencoder; and

FIG. 12 is a block diagram of an embodiment of a partitioning unit.

DETAILED DESCRIPTION

Throughout the drawings, the same reference designations are used forsimilar or corresponding elements.

For a better understanding of the proposed technology, it may be usefulto begin with a brief overview of some aspects of vector splitting.

As an example, consider a 16-dim input vector split in two ways, asillustrated in FIGS. 1A and 1B:

A) Symmetric (8+8) and

B) Asymmetric (2+14).

In both case we have 2 pulses to code in each of the segments.

In case there is no overlap, i.e. the pulses cannot occupy sameposition, and there is no sign to be transmitted, the number of levelsto be encoded and transmitted is calculated as n!/k!(n−k)!, where n isthe dimension of the segment and k is the number of pulses:

A) 28+28=56 levels

B) 1+91=92 levels

In case pulses are allowed to occupy same position, and the sign of thepulses also have to be encoded:

A) 128+128=256 levels

B) 8+392=400 levels

In both cases it is obvious that a more symmetric segmentation is moreefficient. The proposed technology described hereinafter therefore aimsat creating segments of essentially equal size, in order to facilitateefficient coding, preferably positional coding.

A problem associated with a uniform splitting of the input vector isthat the energy variation between different parts could be large, whichwill cause an unstable gain quantization. The proposed technologydescribed hereinafter therefore also aims at determining energy ratiosfor representing a relative energy difference between the segments.

Embodiments of the proposed technology relate to a non-recursive,uniform split of the input vector into segments, and comprise arecursive calculation of energy ratios of a largest possible dimensionfor a certain level.

The bits for coding of the created segments may be distributed based onenergy, and optionally also based on the lengths of the segments.

FIG. 2 illustrates a flow diagram of steps of an embodiment of a methodfor partitioning of input vectors for coding, preferably positionalcoding. Preferably, the input vectors originate from audio signals, butthe ideas presented here also operate well for e.g. video signal aswell. The process begins in step 200. In step 210, an input vector isobtained. In step 220, the input vector is segmented into an integernumber of input vector segments. Preferably, the integer number is thesmallest integer number by which each input vector segment fulfilsconstraints associated with a quantizer for the coding, preferablypositional coding. Such constraints associated with a quantizertypically comprises the actual bit constraints of the quantizer.However, the constraints associated with a quantizer may also compriseadjustments of the effective bitrate cost for representing relativeenergy differences when segmenting said input vector into several inputvector segments. In other words, the number of input vector segments,preferably the minimum number of input vector segments, is determined,where each individual input vector segment is small enough to beprocessed by the coding, preferably positional coding, to follow. Thisinteger number of input vector segments is denoted N^(SEG). Thissegmentation is performed in a non-recursive manner. In step 230, arepresentation of a respective relative energy difference between partsof the input vector on each side of each boundary between the inputvector segments is determined. This is on the other hand performed in arecursive manner.

In a particular embodiment, the bits for coding of the created segmentsmay be distributed based on energy, and optionally also based on thelengths of the segments. In such an embodiment, and thereforeillustrated by a dotted box, the method may comprise the further step240 of allocating bits for coding of each input vector segment andcoding of a representation of relative energy differences between thelevel segments.

According to the main embodiment, in step 250, the input vector segmentsare provided for individual coding, preferably positional coding,together with representations of the energy ratios. The process ends instep 299.

Expressed in a more mathematical manner, an embodiment of thesegmentation can be described as follows. With a length L of an inputvector, a total bit-budget for quantizing this vector B^(TOT), andquantizer constraints (e.g. maximum allowed bits per quantizer/segmentQ^(MAX)) the number of segments be calculated as:

$N^{SEG} = \left\lceil \frac{B^{TOT}}{Q^{MAX}} \right\rceil$

If ┌·┐ is the ceiling function, the quantity N^(SEG) represents thesmallest number of input vector segments that still can be processed bythe intended quantizer. In other words, N^(SEG) is a smallest possibleinteger number of input vector segments, by which each input vectorsegment fulfils constraints of a quantizer for the coding, preferablypositional coding. In particular embodiments, the quantizer constraintsmay be based on the quantity Q^(MAX) and an adjustment term reflectingthe effective bitrate cost for representing relative energy differenceswhen splitting the input vector into several input vector segments.

The length of a segment can be obtained as:

$L^{SEG} = \frac{L}{N^{SEG}}$

If the input vector cannot be divided into equal input vector segments,then:

${L^{SEG} = \left\lfloor \frac{L}{N^{SEG}} \right\rfloor},$where └·┘ is the floor function.

The remaining coefficients L−L^(SEG) N^(SEG) can be distributed to thesegments in several ways, e.g. all included in the last segment orsequentially to each segment until there are no more remainingcoefficients. It is thus preferred to keep a large majority of thesegments to be more or less of the same size. In other words, at leastN^(SEG)−1 of the input vector segments have a respective lengthdiffering by less than 1. In one particular embodiment, all remainingcoefficients are included in the last segment, i.e. the first N^(SEG)−1input vector segments have identical lengths. In another particularembodiment, the remaining coefficients are distributed sequentially toeach segment until there are no more remaining coefficients. Thedifferent input vector segments will thus differ in length with at mostone unit. In other words, all input vector segments having lengths notdiffering by more than 1.

In one embodiment, after a segmenting of the input vector, the shapevector of each segment is quantized. The gain is excluded, e.g. assuminga root-mean-square value of one. Energy ratios describing the relativeenergy differences between the segments are determined, quantized, andused to scale the quantized shape vectors such as the shape of the inputvector is preserved. The energy ratios are calculated recursively fromlower to higher resolution, and in the most symmetrical way. This willbe described by examples in connection with FIGS. 3-6.

In the examples, the segments are characterized by its number of bitsB_(X) ^(SEG) used for representing the segment. In FIGS. 3-6, thesenumbers of bits are also used for denoting the segments themselves. Asegment B₀ ^(SEG) should therefore be understood as the segment beingcoded by the B₀ ^(SEG) bits. Likewise, the representation of a relativeenergy difference is characterized by the bits, e.g. B₀ ^(E), used forcoding that difference.

In FIG. 3, a situation where the input vector is determined to bepartitioned into two segments is illustrated. The input vector of level0, L0, is split in two segments B₀ ^(SEG) and B₁ ^(SEG) of level 1, L1.A trivial case of energy ratio R₀, and a representation B₀ ^(E) of arelative energy difference is provided on one level between thosesegments.

In FIG. 4, a situation where the input vector is determined to be splitinto three segments is illustrated. Energy ratios are provided on twolevels, with the first one being asymmetric due to odd number ofsegments. More in detail, the input vector of level 0, L0, is split intwo segments B₀ ^(SEG) and B₁ ^(SEG) of level 1, L1. The segment B₁^(SEG), or rather the segment to be coded by the B₁ ^(SEG) bits, is hereincluding two of the segments the input vector is partitioned into, theinput vector segments, while the segment B₀ ^(SEG) is including one ofthe input vector segments. An energy ratio R₀, and a representation B₀^(E) of a relative energy difference is provided on level L1 betweenthose segments, B₀ ^(SEG) and B₁ ^(SEG). The segment B₁ ^(SEG) issubsequently handled as a new upper level input vector of level L1 andis in turn split in two segments B₁₀ ^(SEG) and B₁₁ ^(SEG) of level 2,L2. Now, the segments B₁₀ ^(SEG) and B₁₁ ^(SEG) include an equal numberof the input vector segments. An energy ratio R₀₁, and a representationB₀₁ ^(E), of a relative energy difference is provided on level L2between those segments, B₁₀ ^(SEG) and B₁₁ ^(SEG).

In FIG. 5, a situation where the input vector is determined to be splitinto four segments is illustrated. The energy ratios are heresymmetrical in two levels. More in detail, the input vector of level 0,L0, is split in two segments B₀ ^(SEG) and B₁ ^(SEG) of level 1, L1. Thesegments B₁ ^(SEG) and B₀ ^(SEG) are here including an equal number ofinput vector segments. An energy ratio R₀, and a representation B₀ ^(E)of a relative energy difference is provided on level L1 between thosesegments, B₀ ^(SEG) and B₁ ^(SEG) The segment B₀ ^(SEG) is subsequentlyhandled as a new upper level input vector of level L1 and is in turnsplit in two segments B₀₀ ^(SEG) and B₀₁ ^(SEG) of level 2, L2. Thesegments B₀₀ ^(SEG) and B₀₁ ^(SEG) are including an equal number of theinput vector segments. An energy ratio R₀₀, and a representation B₀₀^(E) of a relative energy difference is provided on level L2 betweenthose segments, B₀₀ ^(SEG) and B₀₁ ^(SEG). The segment B₁ ^(SEG) is alsosubsequently handled as a new upper level input vector of level L1 andis in turn split in two segments B₁₀ ^(SEG) and B₁₁ ^(SEG) of level 2,L2. Now, the segments B₁₀ ^(SEG) and B₁₁ ^(SEG) are including an equalnumber of the input vector segments. An energy ratio R₀₁, and arepresentation B₀₁ ^(E) of a relative energy difference is provided onlevel L2 between those segments, B₁₀ ^(SEG) and B₁₁ ^(SEG).

In FIG. 6, a situation where the input vector is determined to be splitinto five segments is illustrated. Here the energy ratios are calculatedon three levels. More in detail, the input vector of level 0, L0, issplit in two segments B₀ ^(SEG) and B₁ ^(SEG) of level 1, L1. Thesegments B₁ ^(SEG) and B₀ ^(SEG) are here not including an equal numberof the input vector segments. An energy ratio R₀, and a representationB₀ ^(E) of a relative energy difference is provided on level L1 betweenthose segments, B₀ ^(SEG) and B₁ ^(SEG). The segment B₀ ^(SEG) issubsequently handled as a new upper level input vector of level L1 andis in turn split in two segments B₀₀ ^(SEG) and B₀₁ ^(SEG) of level 2,L2. The segments B₀₀ ^(SEG) and B₀₁ ^(SEG) are including an equal numberof the input vector segments. An energy ratio R₀₀, and a representationB₀₀ ^(E) of a relative energy difference is provided on level L2 betweenthose segments, B₀₀ ^(SEG) and B₀₁ ^(SEG). The segment B₁ ^(SEG) is alsosubsequently handled as a new upper level input vector of level L1 andis in turn split in two segments B₁₀ ^(SEG) and B₁₁ ^(SEG) of level 2,L2. The segments B₁₀ ^(SEG) and B₁₁ ^(SEG) are not including an equalnumber of the input vector segments. An energy ratio R₀₁, and arepresentation B₀₁ ^(E) of a relative energy difference is provided onlevel L2 between those segments, B₁₀ ^(SEG) and B₁₁ ^(SEG). The segmentB₁₁ ^(SEG) here comprises more than one final segment, and isconsequently causing another level of energy ratio calculations. Thesegment B₁₁ ^(SEG) is therefore handled as a new upper level inputvector of level L2 and is in turn split in two segments B₁₁₀ ^(SEG) andB₁₁₁ ^(SEG) of level 3, L3. The segments B₁₁₀ ^(SEG) and B₁₁₁ ^(SEG) areincluding an equal number of the input vector segments. An energy ratioR₀₁₁, and a representation B₀₁₁ ^(E) of a relative energy difference isprovided on level L3 between those segments, B₁₁₀ ^(SEG) and B₁₁₁^(SEG). Now, all segments are divided.

From the series of figures above, it can be seen that the input vectoris set as an upper level input vector, originally at level L0. Then, inorder to split the input vector in two parts, a center boundary betweeninput vector segments is to be found. The upper level input vector isthereby dividing at the found center boundary, into two “levelsegments”, or lower level input vectors. If the input vector can besplit into two equally large parts, the boundary is found at the center.If the input vector has to be split into two unequally large parts, e.g.caused by an uneven number of segments or segments of differing sizes,the boundary closest on a first side to the center of the upper levelinput vector is preferably selected. In the embodiment of FIGS. 3-6, theboundary at the left side is selected. In other words, if the upperlevel input vector has to be divided into non-equally sized lower levelinput vectors, the center boundary is selected as the boundary closestto the center of the upper level input vector giving a larger last(right) lower level input vector than first (left) lower level inputvector.

A representation of a relative energy difference between the two lowerlevel input vectors is calculated. If at least one of the two lowerlevel input vectors comprise more than one vector segment, the procedureis repeated, but now with the lower level input vectors, comprising morethan one input vector segment, used as upper level input vectors. Thewhole process continues until all boundaries between input vectorsegments are provided with an associated representation of a relativeenergy difference, at some level.

Note that the division into segments is performed non-recursively in afirst stage. In a second stage, the energy differences are determined ina recursive manner.

FIG. 7 illustrates a flow diagram of substeps of an embodiment of a step230 for recursively determining a representation of energy differencesbetween input vector segments. The flow starts from step 220 of FIG. 2.In step 231, the input vector is set as an upper level input vector. Instep 232, a center boundary is found. The center boundary is theboundary between input vector segments being at or closest on a firstside to a center of the upper level input vector. In step 233, the upperlevel input vector is divided at the center boundary into two lowerlevel input vectors. In step 234, a representation of a relative energydifference between the two lower level input vectors is calculated. Instep 235 it is determined whether or not all lower level input vectorsconsists of single segments. All lower level input vectors consists ofsingle segments when all boundaries between input vector segments areprovided with an associated representation of a relative energydifference. If there are remaining lower level input vectors comprisingmore than one segment, the flow continues to step 236, where the lowerlevel input vectors are reset as new upper level input vectors. Theprocess then continues from step 232, repeating the finding, dividingand calculating if necessary. The steps 232, 233 and 234 are notperformed for any upper level input vectors comprising one segment, i.e.not encapsulating any boundary at all.

If, in step 235, it is concluded that all lower level input vectorsconsists of single input vector segments, the flow continues to step 250or 240.

The average number of bits per segment would according to the discussionfurther above be:B ^(SEG) =B ^(TOT) /N ^(SEG)

In a particular embodiment, the average bits per-segment calculatedabove is just an initial estimation that can be re-adjusted aftercalculating the energy ratios between neighboring segments. The bits forcoding of the created segments may be distributed based on energy, andbased on the lengths of the segments. Bits can be transferred fromsegments with lower energy towards segments with higher energy. At thesame time the size L^(SEG) and the segment boundaries are not affected.This is illustrated e.g. as step 240 in FIG. 2, which shows a generalallocation of bits for coding of each input vector segment and coding ofa representation of relative energy differences between the segments,both input vector segments and level segments.

As indicated in FIG. 7, the step 240 of allocating bits for coding ofeach input vector segment and coding of a representation of relativeenergy differences between the level segments may also be included as arecursive process in a hierarchic structure. In other words, theallocation of bits can be performed concurrently to the deter mining, ina recursive manner, of a representation of a respective relative energydifference. With reference to the embodiment illustrated by FIG. 7, itis seen that the step of allocating bits for coding of each input vectorsegments and coding of a representation of relative energy differencesbetween the level segments is performed in connection to the calculationof the representation of relative energy differences.

The hierarchical energy ratio coding can be used to distribute the bitsrecursively to the already determined segments. In the upper level,level L0, the total number of bits B^(TOT) are divided into energy ratiobits B^(E) and segment bits B^(SEG) for the lower level, level L1, suchthatB ^(TOT) =B ^(E) +B ^(SEG),withB ^(SEG) =B ₀ ^(SEG) +B ₁ ^(SEG)where B₀ ^(SEG) and B₁ ^(SEG) are the allocated bits for the left andright level segments, respectively, or in terms of the abovedescription, the first and last lower level input vector in level L1.

This is repeated for each level, in that sense that at each level, thebits allocated to the first and last lower level input vector are, incase lower level input vector encapsulates more than one input vectorsegment, split into bits for coding the representation of the relativeenergy difference and bits for coding the respective first and lastlower level input vector.

If the subsequent layer segment, i.e. lower level input vector consistsof one single cluster or segment the assigned segment bits B^(SH) willbe allocated the shape coding, i.e. for example the second level of FIG.4 where B^(SH)=B₀ ^(SEG).

The level segment bits B^(SEG) are preferably distributed to the firstlevel segments, i.e. the lower level input vectors (that consists of oneor several segments from the clustering of the input vector) based onthe energy ratio between these level segments or lower level inputvectors. In general, the step of allocating bits allocates bits for thelower level input vectors in dependence of a ratio between the number ofcoefficients of the lower level input vectors and a relation between theenergies in the lower level input vectors. The difference φ in bits percoefficient between the level segments is:

$\begin{matrix}{{\varphi = {\frac{B_{1}^{SEG}}{L_{1}^{SEG}} - \frac{B_{0}^{SEG}}{L_{0}^{SEG}}}},} & (1)\end{matrix}$which with a half bit per log 2 energy difference is:

$\begin{matrix}{{\varphi = {{\frac{1}{2}\left( {{\log_{2}\left( E_{1} \right)} - {\log_{2}\left( E_{0} \right)}} \right)} = {\frac{1}{2}{\log_{2}\left( R_{0} \right)}}}},} & (2)\end{matrix}$where E₀ and E₁ are the energies of the left and right level segments,i.e. the first and last lower level input vector, respectively. Theenergy ratio R₀ can equivalently be expressed in terms of an angle α as:R ₀=tan² α,where

$\alpha = {\arctan{\sqrt{\frac{E_{1}}{E_{0}}}.}}$

This means that the number of bits for each level segment is:

$\begin{matrix}{B_{0}^{SEG} = \frac{B^{SEG} - {\varphi\; L_{1}^{SEG}}}{1 + \frac{L_{1}^{SEG}}{L_{0}^{SEG}}}} \\{= \frac{B^{SEG} - {\frac{1}{2}{\log_{2}\left( R_{0} \right)}L_{1}^{SEG}}}{1 + \frac{L_{1}^{SEG}}{L_{0}^{SEG}}}} \\{= \frac{B^{SEG} - {{\log_{2}\left( {\tan(\alpha)} \right)}L_{1}^{SEG}}}{1 + \frac{L_{1}^{SEG}}{L_{0}^{SEG}}}}\end{matrix}$ B₁^(SEG) = B^(SEG) − B₀^(SEG)

Depending on the input vector length L and the number of clusters(segments) N^(SEG), the clusters may not be equally large. This alsocauses some of the lower level input vectors to be of differing size.Also if the number of clusters or segments is different from 2n, somelower level input vectors will be of differing size. The differing sizeof the input vector segments will also have a negative impact on theshape coding in the bands that are larger, due to coding, e.g.positional coding. In order to compensate for the different sized bandsthe difference in bits per coefficient, cf. eq. (1) can be compensatedsuch that:

$\begin{matrix}{{{\left( {\frac{B_{1}^{SEG}}{L_{1}^{SEG}} + f_{1}} \right) - \left( {\frac{B_{0}^{SEG}}{L_{0}^{LEG}} + f_{0}} \right)} = \varphi},} & (3)\end{matrix}$where the compensation factors ƒ_(i) may for example be a functionƒ_(i)=F(N^(SEG), B^(SEG), L_(i) ^(j)) of the cluster lengths L_(i) ^(j),where j is the cluster index (0, . . . , N^(SEG)−1), the number ofsegments N^(SEG) and the segment bits B^(SEG). In other words, thecompensation factors may be dependent on lengths of input vectorsegments, the number of input vector segments within the both lowerlevel input vectors and bits allocated for both lower level inputvectors. Combining eq. (2) and (3) gives the relations:

$B_{0}^{SEG} = \frac{B^{SEG} + {\left( {f_{1} + f_{0}} \right)L_{1}^{SEG}} - {\frac{1}{2}{\log_{2}\left( R_{0} \right)}L_{1}^{SEG}}}{1 + \frac{L_{1}^{SEG}}{L_{0}^{SEQ}}}$B₁^(SEG) = B^(SEG) − B₀^(SEG)where B^(SEG) is the sum of allocated bits for both lower level inputvectors excluding the bits allocated for coding of a representation of arelative energy difference between the lower level input vectors, B₀^(SEG) is the allocated bits for the first lower level input vector, L₀^(SEG) and L₁ ^(SEG) are the lengths of the first and last lower levelinput vectors, respectively, R₀ represents the ratio between theenergies in the lower level input vectors and ƒ₀ and ƒ₁ are compensationfactors for differing lengths of input vector segments within the firstand last lower level input vectors, respectively. The compensationfactors ƒ₀ and ƒ₁ are defined such that they become zero for equallengths of the input vector segments within the first and last lowerlevel segments, respectively.

In one embodiment, the shapes are quantized with a pulse quantizer suchas the PVQ. The compensation factors are based on the average bits persegment and the difference between segment lengths and the minimumsegment length. In other words, the compensation factors are dependenton at least average bits per input vector segment within the first andlast lower level input vectors, respectively, the input vector segmentlengths within the first and last lower level input vectors,respectively, and a minimum input vector segment length.

This can be expressed as:

${f_{i} = {\sum\limits_{j}\left( {F\left( {\frac{B^{SEG}}{N^{SEG}},L_{MIN},L_{i}^{j}} \right)} \right)}},$where B^(SEG) is the sum of allocated bits for both lower level inputvectors and N^(SEG) is the total number of vector segments within bothlower level input vectors.

The function F(·) is defined such that it becomes zero when a cluster isof length L_(MIN). This means that ƒ_(i) becomes zero when all clustersin the corresponding level segment are of length L_(MIN).

In this embodiment, when the remaining coefficients in the clustering,i.e. partitioning of the input vector, L−L^(SEG) N^(SEG) where N^(SEG)denotes the total number of vector segments, are given to the lastcluster only, the compensation factor ƒ₀ becomes zero as all theclusters j are of length L_(MIN). Additionally, as all clusters exceptthe last one, denoted N₁ ^(SEG)−1, are of length L_(MIN), the factor ƒ₁becomes:

$f_{1} = {{F\left( {\frac{B^{SEG}}{N^{SEG}},L_{MIN},L_{1}^{N_{1}^{SEG} - 1}} \right)}.}$

The function F(·) is in the embodiment defined as:

${{F\left( {\frac{B^{SEG}}{N^{SEG}},L_{MIN},L_{1}^{N_{1}^{SEG} - 1}} \right)} = {\frac{B^{SEG}}{N^{SEG}} - {G_{2}\left( {L_{MIN},{G_{1}\left( {L_{i}^{N_{1}^{SEG} - 1},\frac{B^{SEG}}{N^{SEG}}} \right)}} \right)}}},$where the function G₁(·) gives the number of unit pulses that giving thevector length L_(i) ^(N) ¹ ^(SEG) ⁻¹, can be represented using

$\frac{B^{SEG}}{N^{SEG}}$bits. The function G₂(·) gives the number of bits used to represent theby the function G₁(·) determined number of pulses, but for the lowerdimension L_(MIN).

In low complex implementations the complexity of G₁(·) and G₂(·) can bereduced by using approximations or sub-samples lookup tables.

In another embodiment, the compensation factors are also dependent on atleast average bits per input vector segment within the first and lastlower level input vectors, respectively, the input vector segmentlengths and a minimum input vector segment length.

${f_{i} = {\sum\limits_{j}{{- \frac{1}{L_{i}^{SEG}}}\left( {\frac{B^{SEG}}{N^{SEG}} - {G_{2}\left( {{\min\left( L_{i}^{j} \right)},{G_{1}\left( {L_{i}^{j},\frac{B^{SEG}}{N^{SEG}}} \right)}} \right)}} \right)}}},{L_{i}^{SEG} = {\sum\limits_{j}L_{i}^{j}}},$where B^(SEG) is the sum of allocated bits for both lower level inputvectors and N^(SEG) is the total number of vector segments within bothlower level input vectors.

Due to the hierarchical structure of the energy ratios, a parent energyratio may be used to control the bits B^(E) that are used for coding thechild energy ratio. In case the parent energy ratio indicates low energyfor the current segment, B^(E) may be reduced or limited and the savedbits can be redistributed to the shape vector coding using B^(SH) numberof bits.

Further, if the positional vector quantizer, e.g. a complexity optimizedPVQ pulse vector quantizer implementation, is a variable rate quantizer,the bits occasionally saved or spent (exceeded) by the variable ratequantizer for each segment may be incorporated and used to update theremaining segments, including its compensation factors.

Thus, in a case of coding, preferably positional coding, of largevectors, or high-bitrate coding, e.g. high-bitrate positional coding,the input vector may be pre-processed, comprising a partitioning (i.e.clustering or segmentation) prior to the actual quantization. Anadvantage with embodiments described herein is that they offer alightweight solution for partitioning the input vector in an optimal wayfor a positional quantizer. Embodiments also compensate for the casewhen optimal partitioning is not possible, by adjustment of theallocated bits.

The proposed technology provides a partitioning unit configured topartition input vectors for coding, preferably positional coding,wherein partitioning unit is configured to obtain an input vector.Preferably, the partitioning unit is intended for audio signals.However, the ideas presented here also operate well for e.g. videosignal as well. The partitioning unit is further configured to segment,in a non-recursive manner, the input vector into an integer number,N^(SEG), of input vector segments. The partitioning unit is configuredto determine, in a recursive manner, a representation of a respectiverelative energy difference between parts of the input vector on eachside of each boundary between the input vector segments. Thepartitioning unit is also configured to provide the input vectorsegments and representations of the relative energy differences forindividual coding, preferably positional coding.

It will be appreciated that the methods and devices described herein canbe combined and re-arranged in a variety of ways.

For example, embodiments may be implemented in hardware, or in softwarefor execution by suitable processing circuitry, or a combinationthereof.

The steps, functions, procedures, modules and/or blocks described hereinmay be implemented in hardware using any conventional technology, suchas discrete circuit or integrated circuit technology, including bothgeneral-purpose electronic circuitry and application-specific circuitry.

Particular examples include one or more suitably configured digitalsignal processors and other known electronic circuits, e.g. discretelogic gates interconnected to perform a specialized function, orApplication Specific Integrated Circuits (ASICs). One embodiment of apartitioning unit 20 is illustrated in FIG. 8. An input vector of lengthL is obtained through an input section 21. The partitioning unit 20 isconfigured to provide input vector segments and representations ofenergy ratios according to the description here above. The input vectorsegments, together with representation of a respective relative energydifference between parts of the input vector on each side of eachboundary between the input vector segments, are provided for individualcoding, preferably individual positional coding, through the outputsection 29.

Alternatively, at least some of the steps, functions, procedures,modules and/or blocks described herein may be implemented in softwaresuch as a computer program for execution by suitable processingcircuitry such as one or more processors or processing units.

The flow diagram or diagrams presented herein may therefore be regardedas a computer flow diagram or diagrams, when performed by one or moreprocessors. A corresponding apparatus may be defined as a group offunction modules, where each step performed by the processor orprocessors corresponds to a function module. In this case, the functionmodules are implemented as a computer program running on theprocessor(s).

In particular, as illustrated in FIG. 9, the partitioning unit 20 maycomprise a processor 60 and a memory 70. The memory 70 comprisesinstructions executable by the processor 60, whereby the processor 60 isoperative to obtain an input vector, to segment the input vector into aninteger number, N^(SEG), of input vector segments, to determine, in arecursive manner, a representation of a respective relative energydifference between parts of the input vector on each side of eachboundary between the input vector segments; and to provide the inputvector segments and representations of the relative energy differencesfor individual coding, preferably individual positional coding.

Examples of processing circuitry includes, but is not limited to, one ormore microprocessors, one or more Digital Signal Processors (DSPs), oneor more Central Processing Units (CPUs), video acceleration hardware,and/or any suitable programmable logic circuitry such as one or moreField Programmable Gate Arrays (FPGAs), or one or more ProgrammableLogic Controllers (PLCs).

It should also be understood that it may be possible to re-use thegeneral processing capabilities of any conventional device or unit inwhich the proposed technology is implemented. It may also be possible tore-use existing software, e.g. by reprogramming of the existing softwareor by adding new software components.

In the particular example of FIG. 9, at least some of the steps,functions, procedures, modules and/or blocks described herein areimplemented in a computer program, which is loaded into the memory forexecution by processing circuitry including one or more processors. Theprocessor(s) and memory are interconnected to each other to enablenormal software execution. An optional input/output device may also beinterconnected to the processor(s) and/or the memory to enable inputand/or output of relevant data such as input parameter(s) and/orresulting output parameter(s).

The term ‘processor’ should be interpreted in a general sense as anysystem or device capable of executing program code or computer programinstructions to perform a particular processing, determining orcomputing task.

The processing circuitry including one or more processors is thusconfigured to perform, when executing the computer program, well-definedprocessing tasks such as those described herein.

The processing circuitry does not have to be dedicated to only executethe above-described steps, functions, procedure and/or blocks, but mayalso execute other tasks.

In a particular embodiment, the input vector segments have identicallengths or a respective length differing by not more than N^(SEG)−1.

In a particular embodiment, the first N^(SEG)−1 input vector segmentshave identical lengths.

In a particular embodiment, all input vector segments have lengths notdiffering by more than 1.

In a particular embodiment, the partitioning unit is configured toperform the determining, in a recursive manner, of a representation of arespective relative energy difference, by setting the input vector as anupper level input vector, by finding a center boundary, if any, betweeninput vector segments being at or closest on a first side to a center ofthe upper level input vector, by dividing the upper level input vectorat the center boundary, if any, into two lower level input vectors, bycalculating a representation of a relative energy difference between thetwo lower level input vectors if the center boundary exists, and byrepeating the finding, dividing and calculating by re-setting the lowerlevel input vectors as a respective upper level input vector, until allboundaries between input vector segments are provided with an associatedrepresentation of a relative energy difference.

In a particular embodiment, the partitioning unit is configured to, ifthe upper level input vector has to be divided into non-equally sizedlower level input vectors, select the center boundary as the boundaryclosest to the center of the upper level input vector giving a largerlast lower level input vector than first lower level input vector.

In a particular embodiment, the partitioning unit is further configuredto allocate bits for coding of each input vector segments and coding ofa representation of relative energy differences between the segments.

In a particular embodiment, the partitioning unit is configured toperform the allocation of bits concurrently to the determining, in arecursive manner, of a representation of a respective relative energydifference.

In a particular embodiment, the partitioning unit is further configuredto allocate bits for coding of each the input vector segments performedin connection to the calculating of a representation of a relativeenergy difference.

In a particular embodiment, the partitioning unit is configured toperform the allocation of bits by allocating bits for the lower levelinput vectors in dependence of a ratio between lengths of the lowerlevel input vectors and a ratio between the energies in the lower levelinput vectors.

In a particular embodiment, the partitioning unit is configured toperform the allocation of bits by allocating bits for the lower levelinput vector according to the equations presented further above.

In a particular embodiment, the compensation factors are dependent onlengths of input vector segments, the number of input vector segmentswithin lower level input vectors and bits allocated for both lower levelinput vectors.

In a particular embodiment, the compensation factors are dependent on atleast average bits per input vector segment, the input vector segmentlengths and a minimum input vector segment length.

The partitioning unit typically constitutes a part of an encoder. Oneembodiment applies to an encoder, preferably an encoder for positionalcoding, as illustrated in FIG. 10.

Thus, FIG. 10 is a schematic block diagram of a positional encoder 50according to embodiments. The encoder comprises an input unit 10configured to receive an input vector oft length L, a partitioning unit20, a positional quantizer 30, and an output unit 40 for the encodedaudio signal. Preferably, the encoder is configured for positionalencoding of audio signals, i.e. where the input vector represents anaudio signal to be encoded. However, the ideas presented here alsooperate well for e.g. video signal as well.

The positional encoder 50 with its included units could be implementedin hardware. There are numerous variants of circuitry elements that canbe used and combined to achieve the functions of the units of theencoder. Such variants are encompassed by the embodiments. Particularexamples of hardware implementation of the encoder are implementation indigital signal processor (DSP) hardware and integrated circuittechnology, including both general-purpose electronic circuitry andapplication-specific circuitry.

The positional encoder described herein could alternatively, asillustrated in FIG. 11, be implemented e.g. by one or more of aprocessor 60 and adequate software with suitable storage or memory 70therefore, in order to perform the partitioning of an input vector,according to the embodiments described herein. The incoming vector isreceived by an input (IN) 10, to which the processor 60 and the memory70 are connected, and the encoded signal obtained from the software isoutputted from the output (OUT) 40.

In one embodiment, an encoder for positional encoding comprises an inputunit configured to receive an input vector, a partitioning unitaccording to any of the embodiments presented further above, a quantizerand an output unit for an encoded signal.

In a particular embodiment, a computer program comprises instructions,which when executed by at least one processor, cause the processor(s) toobtain an input vector, to segment, in a non-recursive manner, the inputvector into an integer number, N^(SEG), of input vector segments. Theinstructions, when executed by the processor, causes the processor tofurther determine, in a recursive manner, a representation of arespective relative energy difference between parts of the input vectoron each side of each boundary between the input vector segments, and toprovide the input vector segments and representations of the relativeenergy differences for individual coding, preferably positional coding.

The proposed technology also provides a carrier comprising the computerprogram, wherein the carrier is one of an electronic signal, an opticalsignal, an electromagnetic signal, a magnetic signal, an electricsignal, a radio signal, a microwave signal, or a computer-readablestorage medium.

By way of example, the software or computer program may be realized as acomputer program product, which is normally carried or stored on acomputer-readable medium, in particular a non-volatile medium. Thecomputer-readable medium may include one or more removable ornon-removable memory devices including, but not limited to a Read-OnlyMemory (ROM), a Random Access Memory (RAM), a Compact Disc (CD), aDigital Versatile Disc (DVD), a Blu-ray disc, a Universal Serial Bus(USB) memory, a Hard Disk Drive (HDD) storage device, a flash memory, amagnetic tape, or any other conventional memory device. The computerprogram may thus be loaded into the operating memory of a computer orequivalent processing device for execution by the processing circuitrythereof.

In a particular embodiment, a carrier comprises the computer programmentioned further above, wherein the carrier is one of an electronicsignal, an optical signal, an electromagnetic signal, a magnetic signal,an electric signal, a radio signal, a microwave signal, or acomputer-readable storage medium.

The technology described above may be used e.g. in a sender, which canbe used in a mobile device (e.g. mobile phone, laptop) or a stationarydevice, such as a personal computer. The proposed technology may beapplied to a user terminal, which may be a wired or wireless device.

As used herein, the non-limiting terms “User Equipment” and “wirelessdevice” may refer to a mobile phone, a cellular phone, a PersonalDigital Assistant, PDA, equipped with radio communication capabilities,a smart phone, a laptop or Personal Computer, PC, equipped with aninternal or external mobile broadband modem, a tablet PC with radiocommunication capabilities, a target device, a device to device UE, amachine type UE or UE capable of machine to machine communication, iPAD,customer premises equipment, CPE, laptop embedded equipment, LEE, laptopmounted equipment, LME, USB dongle, a portable electronic radiocommunication device, a sensor device equipped with radio communicationcapabilities or the like. In particular, the term “UE” and the term“wireless device” should be interpreted as non-limiting terms comprisingany type of wireless device communicating with a radio network node in acellular or mobile communication system or any device equipped withradio circuitry for wireless communication according to any relevantstandard for communication within a cellular or mobile communicationsystem.

As used herein, the term “wired device” may refer to any deviceconfigured or prepared for wired connection to a network. In particular,the wired device may be at least some of the above devices, with orwithout radio communication capability, when configured for wiredconnection.

It is to be understood that the choice of interacting units or modules,as well as the naming of the units are only for exemplary purpose, andmay be configured in a plurality of alternative ways in order to be ableto execute the disclosed process actions.

The flow diagram or diagrams presented herein may therefore be regardedas a computer flow diagram or diagrams, when performed by one or moreprocessors. A corresponding partitioning unit or positional encoder maybe defined as a group of function modules, where each step performed bythe processor corresponds to a function module. In this case, thefunction modules are implemented as a computer program running on theprocessor. Hence, the partitioning unit or positional encoder mayalternatively be defined as a group of function modules, where thefunction modules are implemented as a computer program running on atleast one processor.

The computer program residing in memory may thus be organized asappropriate function modules configured to perform, when executed by theprocessor, at least part of the steps and/or tasks described herein. Anexample of such function modules is illustrated in FIG. 12.

FIG. 12 is a schematic block diagram illustrating an example of anapparatus for partitioning of input vectors for coding, preferablypositional coding, or partitioning unit 30 comprising a group offunction modules. The partitioning unit 30 comprises an obtaining module401 for obtaining an input vector. The partitioning unit 30 comprises asegmenting module 402 for segmenting, in a non-recursive manner, theinput vector into an integer number, N^(SEG), of input vector segments.The partitioning unit 30 comprises a recursive determining module 403for deter mining, in a recursive manner, a representation of arespective relative energy difference between parts of the input vectoron each side of each boundary between the input vector segments. Thepartitioning unit 30 comprises a providing module 405 for providing theinput vector segments and representations of the relative energydifferences for individual coding, preferably individual positionalcoding.

Preferably, the apparatus for partitioning is configured for positionalencoding of audio signals, i.e. where the input vector represents anaudio signal to be encoded. However, the ideas presented here alsooperate well for e.g. video signal as well.

In a particular embodiment, the partitioning unit 30 also comprises anallocating module 404 for allocating bits to input vector segments andfor a representation of the relative energy differences between lowerlevel segments.

Alternatively it is possibly to realize the modules in FIG. 12predominantly by hardware modules, or alternatively by hardware. Theextent of software versus hardware is purely an implementationselection.

It should also be noted that the units or modules described in thisdisclosure are to be regarded as logical entities and not with necessityas separate physical entities. It will be appreciated that the scope ofthe technology disclosed herein fully encompasses other embodimentswhich may become obvious to those skilled in the art, and that the scopeof this disclosure is accordingly not to be limited.

Reference to an element in the singular is not intended to mean “one andonly one” unless explicitly so stated, but rather “one or more.” Allstructural and functional equivalents to the elements of theabove-described embodiments that are known to those of ordinary skill inthe art are expressly incorporated herein by reference and are intendedto be encompassed hereby. Moreover, it is not necessary for a device ormethod to address each and every problem sought to be solved by thetechnology disclosed herein, for it to be encompassed hereby.

In the preceding description, for purposes of explanation and notlimitation, specific details are set forth such as particulararchitectures, interfaces, techniques, etc. in order to provide athorough understanding of the disclosed technology. However, it will beapparent to those skilled in the art that the disclosed technology maybe practiced in other embodiments and/or combinations of embodimentsthat depart from these specific details. That is, those skilled in theart will be able to devise various arrangements which, although notexplicitly described or shown herein, embody the principles of thedisclosed technology. In some instances, detailed descriptions ofwell-known devices, circuits, and methods are omitted so as not toobscure the description of the disclosed technology with unnecessarydetail. All statements herein reciting principles, aspects, andembodiments of the disclosed technology, as well as specific examplesthereof, are intended to encompass both structural and functionalequivalents thereof. Additionally, it is intended that such equivalentsinclude both currently known equivalents as well as equivalentsdeveloped in the future, e.g. any elements developed that perform thesame function, regardless of structure.

Thus, for example, it will be appreciated by those skilled in the artthat the figures herein can represent conceptual views of illustrativecircuitry or other functional units embodying the principles of thetechnology, and/or various processes which may be substantiallyrepresented in computer readable medium and executed by a computer orprocessor, even though such computer or processor may not be explicitlyshown in the figures.

The functions of the various elements including functional blocks may beprovided through the use of hardware such as circuit hardware and/orhardware capable of executing software in the form of coded instructionsstored on computer readable medium. Thus, such functions and illustratedfunctional blocks are to be understood as being eitherhardware-implemented and/or computer-implemented, and thusmachine-implemented.

The embodiments described above are to be understood as a fewillustrative examples of the present invention, and it should beunderstood that the proposed technology is not limited thereto. It willbe understood by those skilled in the art that various modifications,combinations and changes may be made to the embodiments withoutdeparting from the scope of the present invention. In particular,different part solutions in the different embodiments can be combined inother configurations, where technically possible.

ABBREVIATIONS

-   ASIC Application Specific Integrated Circuit-   B^(E) bits for coding the energy ratio-   B^(SEG) bits per segment-   B^(SH) bits for shape vector corresponding to certain energy ratio-   B^(TOT) total available bit budget-   CD Compact Disc-   CPU Central Processing Unit-   DSP Digital Signal Processor-   DVD Digital Versatile Disc-   E energy per segment on one level-   FPC Factorial Pulse Coding-   FPGA Field Programmable Gate Array-   HDD Hard Disk Drive-   L length (dimension) of the input vector-   L^(SEG) length (dimension) of a segment-   LEE Laptop Embedded Equipment-   LME Laptop Mounted Equipment-   N^(SEG) number of segments-   PC Personal Computer-   PDA Personal Digital Assistant-   PLC Programmable Logic Controller-   PVQ Pyramid Vector Quantization-   Q^(MAX) maximum allowed bits per-quantizer-   R energy ratio between neighboring segments on one level-   RAM Random Access Memory-   ROM Read-Only Memory-   UE User Equipment-   USB Universal Serial Bus

The invention claimed is:
 1. A method for partitioning of input vectorsfor encoding of an audio signal, wherein the method comprises the stepsof: obtaining the audio signal; obtaining an input vector for use inencoding at least a portion of the audio signal; segmenting, in anon-recursive manner, the input vector into an integer number, N^(SEG),of input vector segments; determining energy ratios in a recursivemanner, wherein each determined energy ratio represents a ratio betweenenergies of a left level segment of the input vector and a right levelsegment of the input vector; and providing the input vector segments andthe energy ratios for individual coding, wherein the step of determiningthe energy ratios in a recursive manner comprises: a) dividing the inputvector into: 1) a first left level segment of the input vector and 2) afirst right level segment of the input vector, wherein the first leftlevel segment of the input vector comprises one or more of the inputvector segments and the first right level segment of the input vectorcomprises a different one or more of the input vector segments; b)determining E0, wherein E0 represents an energy of the first left levelsegment of the input vector; c) determining E1, wherein E1 represents anenergy of the first right level segment of the input vector; and d)calculating a first energy ratio (R₀) representing a ratio betweenenergies of the first left level segment and the first right levelsegment, wherein calculating the first energy ratio (R₀) comprisescalculating E1/E0, and the method further comprises determining a numberof bits (B₀ ^(SEG)) to allocate for the first left level segment independence on i) a ratio between the length of the first left levelsegment (L₀ ^(SEG)) and the length of the first right level segment (L₁^(SEG)) and ii) the first energy ratio (R₀); and allocating thedetermined number of bits (B₀ ^(SEG)) for the first left level segment.2. The method according to claim 1, wherein the integer number, N^(SEG),is the smallest integer number by which each the input vector segmentfulfils constraints associated with a quantizer for the coding.
 3. Themethod according to claim 1, wherein the input vector segments haveidentical lengths or a respective length differing by not more than 1.4. The method according to claim 3, wherein the first N^(SEG)−1 inputvector segments have identical lengths.
 5. The method according to claim3, wherein all input vector segments have lengths not differing by morethan
 1. 6. The method according to claim 1, wherein the step ofdetermining the energy ratios further comprises: determining that thefirst right level segment comprises more than one input vector segment;as a result of determining that the first right level segment comprisesmore than one input vector segment, dividing the first right levelsegment into a second left level segment and a second right levelsegment; and calculating a second energy ratio representing a ratiobetween energies of the second left level segment and the second rightlevel segment.
 7. The method according to claim 6, wherein the secondleft level segment is not equal in size to the second right levelsegment.
 8. The method according to claim 6, further comprisingallocating bits for coding of each the input vector segment.
 9. Themethod according to claim 8, wherein the step of allocating bits isperformed in connection to the step of determining the energy rations ina recursive manner.
 10. The method according to claim 6, furthercomprising allocating bits for coding of each the input vector segment.11. The method according to claim 1, wherein allocating bits determiningthe number of bits (B₀ ^(SEG)) to allocate for the first left levelsegment in dependence on i) a ratio between the length of the first leftlevel segment (L₀ ^(SEG)) and the length of the first right levelsegment (L₁ ^(SEG)) and ii) the first energy ratio (R₀) comprisesdetermining the number of bits (B₀ ^(SEG)) for the first left levelsegment according to:${B_{0}^{SEG} = \frac{B^{SEG} + {\left( {f_{1} + f_{0}} \right)L_{1}^{SEG}} - {\frac{1}{2}{\log_{2}\left( R_{0} \right)}L_{1}^{SEG}}}{1 + \frac{L_{1}^{SEG}}{L_{0}^{SEQ}}}},$wherein f₀ and f₁ are compensation factors and B^(SEG) is the number ofavailable bits for shape coding the first left level segment and thefirst right level segment.
 12. The method according to claim 11, whereinthe compensation factors are dependent on lengths of input vectorsegments, the number of input vector segments within both lower levelinput vectors and bits allocated for both lower level input vectors. 13.The method according to claim 12, wherein the compensation factors aredependent on at least average bits per input vector segment within bothlower level input vectors, the input vector segment lengths and aminimum lower level input vector length.
 14. A partitioning unit, thepartitioning unit being configured to: obtain an input vector for use inencoding at least a portion of an audio signal; segment, in anon-recursive manner, the input vector into an integer number, N^(SEG),of input vector segments; determine energy ratios in a recursive manner,wherein each determined energy ratio represents a ratio between energiesof a left level segment of the input vector and a right level segment ofthe input vector; and provide the input vector segments and the energyratios for individual coding, wherein the partitioning unit isconfigured to determine the energy ratios in a recursive manner byperforming a process comprising: a) dividing the input vector into: 1) afirst left level segment of the input vector and 2) a first right levelsegment of the input vector, wherein the first left level segment of theinput vector comprises one or more of the input vector segments and thefirst right level segment of the input vector comprises a different oneor more of the input vector segments; b) determining E0, wherein E0represents an energy of the first left level segment of the inputvector; c) determining E1, wherein E1 represents an energy of the firstright level segment of the input vector; and d) calculating a firstenergy ratio (R₀) representing a ratio between energies of the firstleft level segment and the first right level segment, whereincalculating the first energy ratio comprises calculating E1/E0, and thepartitioning unit is further configured to: determine a number of bits(B₀ ^(SEG)) to allocate for the first left level segment in dependenceon i) a ratio between the length of the first left level segment (L₀^(SEG)) and the length of the first right level segment (L₁ ^(SEG)) andii) the first energy ratio (R₀); and allocate the determined number ofbits (B₀ ^(SEG)) for the first left level segment.
 15. The partitioningunit of claim 14, wherein the partitioning unit comprises a processorand a memory, the memory comprising instructions executable by theprocessor, whereby the processor is operative to determine the energyratios in a recursive manner.
 16. The partitioning unit of claim 14,wherein the integer number, N^(SEG), is the smallest integer number bywhich each the input vector segment fulfils constraints associated witha quantizer for the coding.
 17. The partitioning unit according to claim14, wherein the input vector segments have identical lengths or arespective length differing by not more than
 1. 18. The partitioningunit according to claim 17, wherein the first N^(SEG)−1 input vectorsegments have identical lengths.
 19. The partitioning unit according toclaim 17, wherein all input vector segments have lengths not differingby more than
 1. 20. The partitioning unit according to claim 14, whereinthe process further comprises: determining that the first right levelsegment comprises more than one input vector segment; as a result ofdetermining that the first right level segment comprises more than oneinput vector segment, dividing the first right level segment into asecond left level segment and a second right level segment; andcalculating a second energy ratio representing a ratio between energiesof the second left level segment and the second right level segment. 21.The partitioning unit according to claim 20, wherein the second leftlevel segment is not equal in size to the second right level segment.22. The partitioning unit according to claim 20, wherein thepartitioning unit is further configured to allocate bits for coding ofeach the input vector segment.
 23. The partitioning unit according toclaim 22, wherein the partitioning unit is configured to perform theallocating of bits in connection to the determining the energy ratios ina recursive manner.
 24. The partitioning unit according to claim 14,wherein the partitioning unit is further configured to allocate bits forcoding of each the input vector segment.
 25. The partitioning unitaccording to claim 14, wherein allocating bits for the first left levelsegment in dependence on i) a ratio between the length of the first leftlevel segment (L₀ ^(SEG)) and the length of the first right levelsegment (L₁ ^(SEG)) and ii) the first energy ratio (R₀) comprisesallocating the bits for the first left level segment according to:${B_{0}^{SEG} = \frac{B^{SEG} + {\left( {f_{1} - f_{0}} \right)L_{1}^{SEG}} - {\frac{1}{2}{\log_{2}\left( R_{0} \right)}L_{1}^{SEG}}}{1 + \frac{L_{1}^{SEG}}{L_{0}^{SEQ}}}},$wherein f₀ and f₁ are compensation factors and B^(SEG) is the number ofavailable bits for shape coding the first left level segment and thefirst right level segment.
 26. The partitioning unit according to claim25, wherein the compensation factors are dependent on lengths of inputvector segments, the number of input vector segments within both lowerlevel input vectors and bits allocated for both lower level inputvectors.
 27. The partitioning unit according to claim 26, wherein thecompensation factors are dependent on at least average bits per inputvector segment within both lower level input vectors, the input vectorsegment lengths and a minimum lower level input vector length.
 28. Anencoder for positional encoding, comprising an input unit configured toreceive an input vector representing a signal, a partitioning unitaccording to claim 14, a quantizer and an output unit for an encodedsignal.
 29. A non-transitory computer readable medium comprising acomputer program comprising instructions, which when executed by atleast one processor, causes the at least one processor to: obtain aninput vector for use in encoding at least a portion of an audio signal;segment, in a non-recursive manner, the input vector into an integernumber, N^(SEG), of input vector segments; determine energy ratios in arecursive manner, wherein each determined energy ratio represents aratio between energies of a left level segment of the input vector and aright level segment of the input vector; and provide the input vectorsegments and the energy ratios for individual coding, wherein thecomputer program causes the processor to determine the energy ratios ina recursive manner by causing the processor to perform a processcomprising: a) dividing the input vector into: 1) a first left levelsegment of the input vector and 2) a first right level segment of theinput vector, wherein the first left level segment of the input vectorcomprises one or more of the input vector segments and the first rightlevel segment of the input vector comprises a different one or more ofthe input vector segments; b) determining E0, wherein E0 represents anenergy of the first left level segment of the input vector; c)determining E1, wherein E1 represents an energy of the first right levelsegment of the input vector; and d) calculating a first energy ratiorepresenting a ratio between energies of the first left level segmentand the first right level segment, wherein calculating the first energyratio comprises calculating E1/E0, and the computer program furthercauses the processor to: determine a number of bits (B₀ ^(SEG)) toallocate for the first left level segment in dependence on i) a ratiobetween the length of the first left level segment (L₀ ^(SEG)) and thelength of the first right level segment (L₁ ^(SEG)) and ii) the firstenergy ratio (R₀); and allocate the determined number of bits (B₀^(SEG)) for the first left level segment.
 30. An apparatus forpartitioning of input vectors for coding, wherein the apparatuscomprises: an obtaining module for obtaining an input vector for use inencoding at least a portion of an audio signal; a segmenting module forsegmenting, in a non-recursive manner, the input vector into an integernumber, N^(SEG), of input vector segments; a determining module fordetermining energy ratios in a recursive manner, wherein each determinedenergy ratio represents a ratio between energies of a left level segmentof the input vector and a right level segment of the input vector; and aproviding module for providing the input vector segments and the energyratios for individual coding, wherein the determining module isconfigured to determine the energy ratios in a recursive manner byperforming a process comprising: a) dividing the input vector into: 1) afirst left level segment of the input vector and 2) a first right levelsegment of the input vector, wherein the first left level segment of theinput vector comprises one or more of the input vector segments and thefirst right level segment of the input vector comprises a different oneor more of the input vector segments; b) determining E0, wherein E0represents an energy of the first left level segment of the inputvector; c) determining E1, wherein E1 represents an energy of the firstright level segment of the input vector; and d) calculating a firstenergy ratio representing a ratio between energies of the first leftlevel segment and the first right level segment, wherein calculating thefirst energy ratio comprises calculating E1/E0, and the apparatusfurther comprises a bit allocating configured to: i) determine a numberof bits (B₀ ^(SEG)) to allocate for the first left level segment independence on i) a ratio between the length of the first left levelsegment (L₀ ^(SEG)) and the length of the first right level segment (L₁^(SEG)) and ii) the first energy ratio (R₀); and ii) allocate thedetermined number of bits (B₀ ^(SEG)) for the first left level segment.